import format from '@dfeidao/atom-web/dt/format';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import show from '@dfeidao/atom-web/ui/show';

export default async function a001(fd: IFeidaoAiBrowserComponent,nos: string) {
	// todo
	const addtol=fd.data.node.querySelector<HTMLDivElement>('[data-id="show"]');
	set_node_cls(addtol, 'display-n',false);
	show(fd.data.node);
	const ret = await nodejs<{dt: Array<{exam_name: string;start_time: number;
		examination_category: string;exam_time: string;exam_score: string;exam_explain: string;
				finish_time: number}>}>('examination-management/zj-000004/s001',{
				exam_id:nos
			});
			set(fd,'nos',nos);
			const exam_name = fd.data.node.querySelector<HTMLSpanElement>('[data-id="exam_name"]') as HTMLInputElement;
			const examination_category = fd.data.node.querySelector<HTMLSpanElement>('[data-id="examination_category"]') as HTMLInputElement;
			const exam_score = fd.data.node.querySelector<HTMLSpanElement>('[data-id="exam_score"]') as HTMLInputElement;
			const exam_time = fd.data.node.querySelector<HTMLSpanElement>('[data-id="exam_time"]') as HTMLInputElement;
			const exam_explain = fd.data.node.querySelector<HTMLDivElement>('[data-id="exam_explain"]') as HTMLInputElement;
			const start_time1 = fd.data.node.querySelector<HTMLSpanElement>('[data-id="start_time"]') as HTMLInputElement;
			const finish_time1 = fd.data.node.querySelector<HTMLSpanElement>('[data-id="finish_time"]') as HTMLInputElement;
			const finish_time = format(ret.dt[0].finish_time,2);
			const start_time = format(ret.dt[0].start_time,2);
			exam_explain.innerText = ret.dt[0].exam_explain;
			exam_name.innerText = ret.dt[0].exam_name;
			examination_category.innerText = ret.dt[0].examination_category;
			exam_score.innerText = ret.dt[0].exam_score;
			exam_time.innerText = ret.dt[0].exam_time;
			start_time1.innerText = start_time;
			finish_time1.innerText = finish_time;
}
